package org.zhixiang.gisQuery.utils;

import org.zhixiang.gisQuery.rtree.RTree;
import org.zhixiang.gisQuery.rtree.Rectangle;

/**
 * 
 * @say little Boy, don't be sad.
 * @name Rezar
 * @time 2018年9月21日 下午2:53:45
 * @Desc 些年若许,不负芳华.
 *
 */
public class RegionRectMarker {

	public Rectangle findMinBound(Rectangle maxRect, int xCount, int yCount) {

		return null;
	}

	/**
	 * @param rectangle
	 * @param xCount
	 * @param yCount
	 * @return
	 */
	public static int[][] initBlocks(RTree rtree, Rectangle rectangle, int xCount, int yCount) {
		double blockX = (rectangle.maxX - rectangle.minX) / xCount;
		double blockY = (rectangle.maxY - rectangle.minY) / yCount;
		int[][] retBlockDatas = new int[xCount][yCount];
		for (int x = 0; x < xCount; x++) {
			for (int y = 0; y < yCount; y++) {
				retBlockDatas[x][y] = checkInRegio(rtree, blockX * x, blockY * y, blockX * x + blockX,
						blockY * y + blockY);
			}
		}

		return null;
	}

	/**
	 * @param rtree
	 * @param d
	 * @param e
	 * @param f
	 * @param g
	 * @return
	 */
	private static int checkInRegio(RTree rtree, double minX, double minY, double maxX, double maxY) {
		boolean inRegio = true;
		

		return inRegio ? 1 : 0;
	}

}
